/* 全局样式 */
body {
    background-color: #f9f5ff; /* 淡紫色背景 */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    color: #333;
}

/* 顶部导航栏 */
.header {
    background-color: #8a5acd; /* 中等紫色导航栏 */
    color: white;
    padding: 15px 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header .container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header .logo {
    font-size: 24px;
    font-weight: bold;
    text-decoration: none;
    color: white;
}

.header .search-box {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header .search-box input {
    padding: 8px 15px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    flex-grow: 1;
    max-width: 500px;
    background-color: #f0e6fa;
}

.header .search-box input:focus {
    outline: 2px solid #9c6ade;
}

.header .search-box button {
    padding: 8px 25px;
    background-color: #9c6ade; /* 淡紫色按钮 */
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.header .search-box button:hover {
    background-color: #7d4ac1;
    transform: translateY(-1px);
}

.header .nav a {
    color: white;
    margin-left: 20px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s;
    padding: 8px 12px;
    border-radius: 4px;
}

.header .nav a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* 轮播图 */
.slider {
    height: 500px;
    margin: 20px auto;
    overflow: hidden;
    max-width: 1200px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(156, 106, 222, 0.1);
}

.slides {
    display: flex;
    width: 300%;
    animation: slide 15s infinite;
}

.slides img {
    width: 33.33%;
    height: 500px;
    object-fit: cover;
}

@keyframes slide {
    0% { transform: translateX(0); }
    33% { transform: translateX(-33.33%); }
    66% { transform: translateX(-66.66%); }
    100% { transform: translateX(0); }
}

/* 商品分类 */
.categories {
    padding: 40px 20px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    text-align: center;
    margin: 30px auto;
    max-width: 1200px;
}

.categories h2 {
    font-size: 32px;
    color: #7d4ac1; /* 深紫色标题 */
    margin-bottom: 30px;
    position: relative;
    display: inline-block;
}

.categories h2::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: #9c6ade;
}

.category-list {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 30px;
}

.category-item {
    width: 180px;
    padding: 15px;
    border: 1px solid #f0e6fa;
    border-radius: 10px;
    transition: all 0.3s;
    background-color: #fcfaff;
}

.category-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(156, 106, 222, 0.15);
    border-color: #9c6ade;
}

.category-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
    border: 1px solid #f0e6fa;
}

.category-item p {
    font-size: 18px;
    color: #5a3d7a;
    margin: 0;
    font-weight: 500;
}

/* 商品列表 */
.products {
    padding: 40px 20px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    text-align: center;
    margin: 30px auto;
    max-width: 1200px;
}

.products h2 {
    font-size: 32px;
    color: #7d4ac1;
    margin-bottom: 30px;
    position: relative;
    display: inline-block;
}

.products h2::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: #9c6ade;
}

.product-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.product-card {
    border: 1px solid #f0e6fa;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s;
    background-color: #fcfaff;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(156, 106, 222, 0.15);
    border-color: #9c6ade;
}

.product-img {
    height: 300px;
    overflow: hidden;
    background-color: #f0e6fa;
}

.product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.product-card:hover .product-img img {
    transform: scale(1.05);
}

.product-info {
    padding: 20px;
    text-align: left;
}

.product-title {
    font-size: 20px;
    color: #5a3d7a;
    margin: 10px 0;
    height: 40px;
    overflow: hidden;
    font-weight: 500;
}

.product-price {
    color: #9c6ade;
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 15px;
}

.add-to-cart {
    width: 100%;
    padding: 12px;
    background-color: #9c6ade;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s;
}

.add-to-cart:hover {
    background-color: #7d4ac1;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(156, 106, 222, 0.3);
}

/* 页脚 */
.footer {
    background-color: #5a3d7a; /* 深紫色页脚 */
    color: white;
    text-align: center;
    padding: 40px 20px;
    margin-top: 50px;
}

.footer p {
    font-size: 16px;
    margin: 0;
    line-height: 1.6;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
}

.footer-links a {
    color: white;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #d9b3ff;
    text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .header .nav {
        margin-top: 15px;
    }
    
    .header .nav a {
        margin: 0 10px;
    }
    
    .product-list {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .slider {
        height: 300px;
    }
    
    .slides img {
        height: 300px;
    }
}